<template>
    <div>
        <a-modal
            title="选择图标"
            :visible="visible"
            :confirm-loading="confirmLoading"
            :footer="false"
            width="60%"
            @ok="handleOk"
            @cancel="handleCancel"
        >
        <i v-for="(item,index) in iconList" class="iconfont" :class="item.fcode" @click="selectIcon(item)"></i>
        </a-modal>
        </div>
    </template>
<script>
import { axios } from '@/utils/request'
import YchConstant from "@/api/YchConstant";
export default {
    data() {
        return {
            visible: false,
            confirmLoading: false,
            iconList: []
        };
    },
    mounted(){
        this.getData()
    },
    methods: {
        getData(){
            axios({
                url: YchConstant.SPZX_SPCY + '/icon/queryIconList',
                method:'get' ,
                // params: {...parameter,fywflcode:this.selectTableConfig.fywflcode,pageNo:tablePage.currentPage,pageSize:tablePage.pageSize},
                url_1:'outside'
            }).then(res=>{
                //console.log('queryIconList',res)
                this.iconList = res.result
            })
        },
        selectIcon(item){
            this.$emit('receiveIcon',item.fcode)
            this.handleCancel()
        },
        handleOk(e) {
            this.confirmLoading = true;
            setTimeout(() => {
                this.visible = false;
                this.confirmLoading = false;
            }, 2000);
        },
        handleCancel() {
            this.visible = false;
        },
    },
};
</script>
<style scoped>
    i {
        font-size: 30px;
        margin: 20px 20px 0 20px;
    }
</style>
